All Questions
698 questions
2votes
1answer
187views
Using Here-Document as password Input for ssh
First, I do know this is a security risk. I do know about ssh keys and sshpass. This belongs to a fun project. I wondered if a bash Here-Document could be used as a password input for ssh. I ...
2votes
1answer
150views
Redirect multiple Bash code files to SSH with Escaping (same SSH session)
Need to redirect 3 bash code files (possibly more in the future) to SSH, escaping them (within the same SSH session) to execute them on remote host. Perfectly fine to list bash code files manually. ...
0votes
0answers
66views
How Do SSH-Launched Long-Running Background Jobs Detach Without nohup or disown?
When running a long-running command in the background over SSH from a non-interactive shell script, I noticed the process continues running on the remote machine without using nohup, disown, or ...
0votes
1answer
52views
Commenting out a line item in a text file that my bash .sh file refers to
I have an ssh .sh bash script file i'm running on a cron to check website status. The bash script (when ran) refers to a local txt file for a list of websites to check if they're down or up. ...
6votes
5answers
2kviews
Download a file with SSH/SCP, tar it inline and pipe it to openssl
I want to download a list of files from a SSH server, then put it in some kind of container (like a tar file) and finally encrypt it (e.g. with openssl). The point of putting it into a archive is to ...
0votes
1answer
105views
Return multi-line ssh output to separate variables?
RHEL 8.10 OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 As expected, this line (with two embedded commands) returns two rows: $ ssh -q remoteserver "ls -1 /proc/${p}/fd | wc -l ; ps -Ostate -p$...
9votes
1answer
600views
Why is bash startup executed under non-interactive ssh
I see an unexplained difference in behavior with ssh on Linux and FreeBSD, and it is the FreeBSD behavior that I would expect from the plain language of the manpages. So, something extra happens on ...
0votes
1answer
51views
How to Load Personal .bash_rc for SU User via Direct SSH command
Problem Multiple engineers are using same machine with same loginuser and history gets loaded with others' people commands. Update: People login via private ssh keys (pub added/removed via trustedhosr)...
1vote
0answers
19views
While Loop Exits After Calling Function [duplicate]
I'm trying to do a db backup script using Bash. When adding a "Resume" feature to the script, I do the following loop calling defined functions to do step by step (depending on the .lock ...
1vote
2answers
334views
How to make ssh return immediately after running background job
When I run on linux-system/bash: sleep 10 & I get bash prompt immediately. But when I run: ssh linux-system 'sleep 10 &' I wait 10 seconds. Two questions: Can I find explanation in ssh/bash ...
0votes
0answers
26views
Ghost string in terminal, string doesn't go away when using backspace [duplicate]
Linux shell problem on a server, bash 5.1.4(1)-release. Debian 11.10. I have this on my command line right now after pressing the up arrow: server# ctr plugins listkubeadm init --pod-network-cidr=10....
0votes
1answer
242views
X11 DISPLAY Configuration for SSH and Nvidia Optimus Graphics
There are one Intel integrated graphics and the other Nvidia graphics card in my remote box, where OpenSSH and X11 servers run on Ubuntu Desktop 24.04. The graphics drivers and utils are installed ...
-2votes
1answer
234views
How do I get lastlog timestamps in a generic format?
I have multiple Ubuntu machines in different locations. I want to collect the last login information from these machines. However, when I use the lastlog command, it returns dates in different formats....
0votes
1answer
73views
Is there a way to run a custom setup script on a shared ssh login, but only for me?
I share an ssh login with my colleagues. Although generally fine people, they have certain flaws - for example a preference for emacs-style bash editing, their own (incorrect) alias preferences, etc. ...
5votes
3answers
320views
Setting PS1 with site-wide configuration
I've had problems with people logging into some servers via ssh and forgetting that a specific terminal is no longer local. Today someone tried to shutdown their laptop with sudo shutdown -h now, and ...